﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using GlobalDefine;

namespace VoteMeApp
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            initAllVariable();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmLogon());
        }

        private static void initAllVariable()
        {
            //throw new Exception("The method or operation is not implemented.");
            //init all variable for this application;
            //load application path
            VariableDefine.strAppPath = Directory.GetCurrentDirectory();
            //load ini file
            VariableDefine.strConfLocation = VariableDefine.strAppPath + @"\conf.ini";
            //load users
            VariableDefine.strUsers = VariableDefine.getDefinefromINI(@"USERS");   
             
            //load rates
            VariableDefine.strRates = VariableDefine.getDefinefromINI(@"RATES");   

            //load groups
            VariableDefine.strGroups = VariableDefine.getDefinefromINI(@"GROUPS");

            //load location of pic
            VariableDefine.strPicLocation = VariableDefine.getDefinefromINI(@"PICTURE LOCATION");

        }
    }
}